import request from "@/utils/fetch"


//获取黑榜信息
export async function getBlackList(params: {
    //类型 1、行业动态 2、红黑榜
    type: '1' | '2'
}): Promise<BlackListRes[]> {
    return await request<BlackListRes[]>({
        url: '/qdjx/baseinfo/getSysNewsList.do',
        method: 'get',
        params
    })

}

//获取所有驾校信息
export async function getSchoolList(params: {
    distructId: string,
    level: string,
    schoolName: string
}): Promise<SchoolListRes[]> {
    return await request<SchoolListRes[]>({
        url: '/qdjx/baseinfo/getAllSchoolList.do',
        method: 'get',
        params
    })
}

//获取所有教练
export async function getCoachList(params: {
    pageIndex:number,
    pageSize:number,
    coachName: string,
    level: string,
    schoolId: string
    [k:string]:any
}): Promise<CoachListRes> {
    return await request<CoachListRes>({
        url: '/qdjx/baseinfo/getCoachInfo.do',
        method: 'get',
        params
    })
}


export interface BlackListRes {
    fileUrl: string;
    name: string;
    photoUrl: string
}

export interface SchoolListRes {
    //合格率
    passRate: string,
    //照片
    photoUrl: string,
    //满意度
    satisfactionRate: string,
    //驾校id
    schoolId: string,
    //驾校名称
    schoolName: string,
    //驾校使用的银行名
    schoolUseBankName: string,
    //驾校简称
    shortName: string,
    //宣传视频
    video: string
}

export interface CoachListRes {
    coachVOList:CoachVOList[],
    count:number
}

export interface CoachVOList{
    //教练id
    coachId: string
    //教练名
    coachName: string
    //教练照片
    coachPhotoUrl: string
    //个人介绍
    describe: string
    //教练星级 1-5
    level: string
    //合格率
    passRate: string
    //满意度
    satisfactionRate: string
    //所属驾校id
    schoolId: string
    //所属驾校
    schoolName: string
    //培训车型名称
    teachVehicleKind: string
    //宣传视频
    video: string
}